<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    
</body>
<script>
    //生成对象的函数
    function createMovie(movieName,type,rate,showTime){
        var movieObj = {};
        movieObj.movieName = movieName;
        movieObj.type = type;
        movieObj.rate = rate;
        movieObj.showTime = showTime;
        movieObj.getNextShowing = function(){
            var current  = 11;
            for(var i = 0;i<movieObj.showTime.length;i++){
                if(current < parseInt(movieObj.showTime[i])){
                    console.log("下一次播放时间"+movieObj.showTime[i]);
                }
            }
        }
        return movieObj;
    }

    var movie1 = createMovie("007","谍战类","9.0",["10:00","12:00","15:00"]);
    var movie2 = createMovie("指环王","冒险类","9.2",["13:00","16:00","19:00"]);
    console.log(movie1);
    console.log(movie2);
</script>
</html>